<?php
/**
 * $Id: default.php 11917 2009-05-29 19:37:05Z ian $
 */
defined( '_JEXEC' ) or die( 'Restricted access' );
?>
<!-- Top banner block-->

<div class="top_banner col2"><img src="<?php echo $this->baseurl ?>/templates/mwc/medias/images/banner_ydelser.jpg" alt="Kontakt os" /></div>
<!-- / End top banner block-->
<!-- Begin main content -->
<div id="main" class="feedback">
  <!-- Begin product list  -->
  <div class="content_ctn col2">
    <h1 class="main_title"><span>Feedback</span></h1>
    <div id="feedbackContent">
      <div class="feedback_ctn">
        <div class="left_ctn">
          <div class="right_ctn">
            <form id="feedbackForm" action="<?php echo JRoute::_('index.php'); ?>" method="post">
              <fieldset>
              <p class="desc">Udfyld felterne nedenfor for at oprette en konto Alle felter markeret <span class="red">*</span> skal udfyldes!</p>
              <label>Kontaktperson:</label>
              <input class="text required" type="text" name="person" id="person" value=""/>
              <label>Email:</label>
              <input class="text required email" type="text" name="email" id="email" value=""/>
              <label>Emne:</label>
              <input class="text required" type="text" name="subject" id="subject" value=""/>
              <label>Din besked:</label>
              <textarea rows="4" class="required" name="desc" id="desc" cols="10"></textarea>
              <div class="actions"> <a id="sendBtn" class="click_btn" href="javascript:void(0);" onclick="click_send();">Send</a> <a id="resetBtn" class="click_btn" href="javascript:void(0);" onclick="reset_form();">Nulstil</a> </div>
              </fieldset>
			  <input type="submit" name="send" id="send" value="Send" style="display: none;" />
			  <input type="hidden" name="option" value="com_feedback" />
              <input type="hidden" name="view" value="" />
              <input type="hidden" name="id" value="" />
              <input type="hidden" name="task" value="submit" />
			  <?php echo JHTML::_( 'form.token' ); ?>
            </form>
          </div>
        </div>
      </div>
    </div>
  </div>
  <!-- /end product list  -->
</div>
<!-- / end main content -->
<script language="javascript">
	jQuery(document).ready(function($) {			
		jQuery("#feedbackForm").validate({
			errorPlacement: function(error, element) {			
			},
			invalidHandler: function(form, validator) {
			  var errors = validator.numberOfInvalids();
			  if (errors) {
                $('#alert').html(validator['errorList'][0]['message']);
    			$('#backoverlay').show();
    			$('#show_popup').show();
                $('#f_focus').html(validator['errorList'][0]['element'].name);
				validator['errorList'][0]['element'].focus();
			  } else {
			  }
			},
			rules: {
                person : "required",
                email: {
					required: true,
					email: true
				},
				subject: "required",
                desc: "required"
				
			},
			messages: {
                person: "<?php echo JText::_( 'Kontaktperson skal udfyldes' ); ?>",
                email: "<?php echo JText::_( 'Email skal udfyldes!' ); ?>",
                subject: "<?php echo JText::_( 'Emne skal udfyldes!' ); ?>",
				desc: "<?php echo JText::_( 'Din beskeds skal udfyldes!' ); ?>"
			}
		});
        close_popup=function(){		
    		var fel=$('#f_focus').html();
            $('#backoverlay').hide();
    		$('#show_popup').hide();
    		$('#' + fel ).focus();
      };
      reset_form=function(){
            jQuery("#feedbackForm")[0].reset()
      };
      click_send=function(){
            document.getElementById('send').click();
      }  
	});
</script>
